package com.sinosoft.perfect.system._resource.service;

import java.sql.SQLException;
import java.util.List;

import com.sinosoft.perfect.system._.po.TResourceSystem;
import com.sinosoft.perfect.system._.po.TResourceSystemImg;

public interface IResourceService {

	/**
	 * 增加系统资源
	 */
	public String insertTResource(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 按条件查询系统资源
	 */
	public List<TResourceSystem> selectTResource(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 根据resourceName，查询是否有同名资源，1：有，0：没有
	 */
	public int hasTResourceName(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 根据resourceId查询所有层级子资源，当前资源及子资源的resourceId数组
	 */
	public String[] selectTResourceAndChildIds(String resourceId) throws SQLException;

	public List<TResourceSystem> selectTResourceAndParents(String resourceId) throws SQLException;
	
	/**
	 * 根据资源level和资源superResouceId，查询最大排序编码，返回查询到的编码
	 */
	public Long selectTResourceSortNum(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 根据资源level和资源superResouceId，查询最小排序编码，返回查询到的编码
	 */
	public Integer selectTResourceSortNumMin(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 根据资源name和资源superResouceId，查询排序编码，返回查询到的编码
	 */
	public Long selectTResourceSortNumByName(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 更新系统资源
	 */
	public void updateTResourceByPK(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 更新资源及子资源的状态，返回更新资源的resourceIds
	 */
	public String[] updateTResourceForStatusByPK(TResourceSystem tresourcesystem) throws SQLException;

	/**
	 * 删除资源及子资源
	 */
	public void deleteTResources(String[] resourceIds) throws SQLException;

	public void deleteTResourceByPK(String resourceId) throws SQLException;

	public boolean sortResource(long newSortNumber, String resourceId) throws SQLException;
	
	
	public List<String> getResourceImgsName(String fpath);
	
	public void insertTResourceImg(TResourceSystemImg tresourceSystemImg) throws SQLException;
	public void updateTResourceImg(TResourceSystemImg tresourceSystemImg) throws SQLException;
	public void deleteTResourceImg(TResourceSystemImg tresourceSystemImg) throws SQLException;
	public List<TResourceSystemImg> selectTResourceImg(TResourceSystemImg tresourceSystemImg) throws SQLException;
}
